home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / CONTRIB / ZLIB_PC.ZIP / zlib_pc / zlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-20  |  1.7 KB  |  90 lines

  1. #ifndef _ZLIB_H
  2. #define _ZLIB_H 1
  3.  
  4. /*
  5.  *    header for for zlib (compress file i/o utilities)
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. #if defined(MSDOS) && !defined(__GNUC__)
  11. # define PC_HUGE    huge        /* Microsoft C and contemptibles */
  12. #else
  13. # define PC_HUGE
  14. #endif
  15.  
  16. #if defined(unix) || defined(__unix)
  17. #define ZEXT        ".Z"        /* "normal" compressed file ext */
  18. #else
  19. #define ZEXT        "Z"        /* "normal" compressed file ext */
  20. #endif
  21.  
  22. #ifdef __arm
  23. # undef ZEXT
  24. # define ZEXT        "-z"
  25. #endif
  26.  
  27. #define Z_BITS        16
  28. #define Z_MAXBUF    256
  29.  
  30.  
  31.  
  32. /*
  33.  *    the major data structure, ZFILE
  34.  */
  35. typedef struct zfiletype
  36. {
  37.     FILE           *file;
  38.     int        flags;
  39.     int         n_bits;        /* number of bits/code */
  40.     int         maxbits;    /* user settable max # bits/code */
  41.     long        maxcode;    /* maximum code, given n_bits */
  42.     long        free_ent;    /* first unused entry */
  43.     int         block_compress;
  44.     int         clear_flg;
  45.  
  46.     long        stackp;
  47.     long        finchar;
  48.     long        code,
  49.                 oldcode,
  50.                 incode;
  51.     int         offset,
  52.                 size;
  53.     unsigned char   buf[Z_BITS];    /* Passed to getcode */
  54.     unsigned char PC_HUGE *tab_suffixof;
  55.                     /* There is a flag bit to say whether*/
  56.     long PC_HUGE   *tab_prefixof;    /* these have been allocated.        */
  57.     int         init;
  58.  
  59.     int         bufput,
  60.                 bufget,
  61.                 bufend;
  62.     unsigned char   buff[Z_MAXBUF];
  63.     int         c1,
  64.                 c2;
  65.     int         zeof;
  66.  
  67. } ZFILE;
  68.  
  69.  
  70. /*
  71.  *    function prototypes...
  72.  */
  73. #if defined(__STDC__)
  74. ZFILE  *zfopen(char *fileptr, char *how);
  75. void    zfclose(ZFILE *z);
  76. ZFILE  *zfilter(FILE *f);
  77. int     zfgetc(ZFILE *z);
  78. int     zfeof(ZFILE *z);
  79. char   *zfgets(char *line, int len, ZFILE *zfp);
  80. #else
  81. ZFILE  *zfopen();
  82. void    zfclose();
  83. ZFILE  *zfilter();
  84. int     zfgetc();
  85. int     zfeof();
  86. char   *zfgets();
  87. #endif
  88.  
  89. #endif /*_ZLIB_H*/
  90.